package com.glory.cqaospda.viewmodel

import com.glory.cqaospda.model.TaskRepository
import com.glory.mvvmnet.base.BaseViewModel
import com.glory.mvvmnet.entity.CallObserveBean
import com.google.gson.JsonObject

class Repair2ItemModel:BaseViewModel() {

    private val repository by lazy { TaskRepository() }

    fun defaultGetBaseConfig(){

        val map = JsonObject()
        map.addProperty("GroupID", "maintain_content")

        launchOnlyResult({
            val baseConfigBean =
                repository.defaultGetBaseConfig(map,"EMS_GetBaseConfig")
            defUI.callObserve.value = CallObserveBean(1,baseConfigBean)
        })
    }

    fun defaultMaintenanceOrder(map:JsonObject){

        launchOnlyResult({
            repository.defaultMaintenanceOrder(map,"EMS_MaintenanceOrder")
            defUI.callObserve.value = CallObserveBean(2)
        })
    }

}